<?php
class Macys_View_Helper_CategorySidePanel extends Zend_View_Helper_Abstract {

	public $view;
	public $log;

	public function setView(Zend_View_Interface $view) {
		$this->view = $view;

	}

	public function categorySidePanel() {
		$this->log = Zend_Registry::get('log');
		$cat = Macys_Api_V2_Catalog_Category::getInstance();
		$response = $cat->getResponse();
		if(empty($response)) {
			$pages = null;
		}
		else {
			$categories = $cat->getResponse()->getCategoryNavigation();
			if(empty($categories)) {
				$pages = null;
			} 
			else {
				$pages = array($categories);
			}
			
		}
		//$x = new Zend_Navigation();
		//$pages = $cat->getProcessedNavigationCategories();
		//$pages = array($cat->getResponse()->getCategoryNavigation());
		//$x->addPages(array($pages));
		//return $x;
		
	if(empty($pages)) {
			
			//array("label"=>"No Data Available");
			$a = new Zend_Navigation_Page_Mvc(array("label"=>"No Data Available", "controller"=> "index", "action"=>"index"));
			$x = new Zend_Navigation(array($a));	
		}
		else {
		$x = new Zend_Navigation($pages);	
		}
		return $x;
		
	}




}